The present disclosure relates to an electronic device and an image pickup apparatus applied to a mobile electronic device such as a digital camera and a mobile telephone.
In related art, a mobile electronic device such as a digital camera and a mobile telephone has achieved functions of presenting a front-facing direction of a device to a user of the device and providing convenience or entertainment to the user by using the direction. For example, a compass function of displaying a current direction of an image pickup apparatus on a display screen becomes popularized. Further, a function becomes popularized of storing data of a photographer position and a photographing direction together with image data of a picture when the picture is shot, and displaying the picture on a map with direction data when the picture is viewed. In order to achieve those functions, an electromagnetic compass appropriate for embedding is often used because of a small size.
However, the electromagnetic compass is affected by magnetic disturbance or the like thereby including a fluctuation in a detected direction because the electromagnetic compass detects a magnetic direction by using a magnetic sensor. In order to remove the fluctuation, a method using a low-pass filter or averaging processing for cancelling a high-frequency component may be used. However, there is a problem that the low-pass filter and averaging processing deteriorates response. Especially, in comparison with a direction sensor mounted on large equipment such as a ship and a vehicle, deterioration in response often becomes more of a problem for the mobile electronic device due to high-speed change in direction in response to user action.
Further, the mobile electronic device has various factors inside to disturb magnetism. Hereinafter, such disturbance may be referred to as magnetic disturbance. For example, the magnetic disturbance may occur due to movement of various mechanism embedded in the device such as a motor driven in zooming, charge and discharge of a flash, shutter mechanism and autofocus mechanism. For this reason, it is necessary for the image pickup apparatus so as not to be affected by the magnetic disturbance occurring in the device when the electromagnetic compass is embedded in the image pickup apparatus.
In order to compensate for shortcomings of the electromagnetic compass, it has been already proposed to use the electromagnetic compass in combination with a highly-responsive angular velocity sensor as typified by a gyro sensor. The magnetic direction detected by the electromagnetic compass has the characteristics such that though response is low and fluctuation occurs, detection accuracy is high in the long term (when processed by the low-pass filter or averaging). On the other hand, an integration direction obtained by integration of an output from the angular velocity sensor has the characteristics such that though response is high in the short term, detection accuracy is low in long term due to occurrence of a drift phenomenon in which an error is added.
In Japanese Patent Laid-Open No. 11-344339, a highly accurate electromagnetic compass having high response is achieved by processing a difference between the magnetic direction and the integration direction by using a low-pass filter, adding the integration direction to the processed resultant and outputting the addition resultant In Japanese Patent Laid-Open No. 2008-281494, a wearable position detecting mobile terminal device is disclosed in which a geomagnetic vector is acquired from a magnetic sensor at predetermined time intervals and calculates geomagnetic amount of change that is an amount of change in a magnitude of the geomagnetic vector in the predetermined time. In the case where the calculated geomagnetic amount of a change is within a range of a predetermined threshold value, a direction of a wearing person is determined based on the geomagnetic vector acquired by the magnetic sensor. In the case where the calculated geomagnetic amount of change is outside a range of the predetermined threshold value, the direction of the wearing person is determined by employing the latest direction determined based on the latest geomagnetic vector indicating the geomagnetic amount of change within the range of the predetermined threshold value. Alternatively, in this case, a rotation amount added direction obtained by adding a rotation amount acquired by a gyro sensor to the latest direction is determined as the direction of the wearing person. In Japanese Patent Laid-Open No. 8-114454, by using a magnetic direction indicator and a rotation angular velocity sensor, a relative rotation angle is obtained based on angular velocity data detected by the rotation angular velocity sensor. Further, standard deviation is obtained by performing statistical processing on azimuth angle data of magnetic direction indicator and in the case where the standard deviation is relatively large, it is determined that magnetic disturbance is occurring and the relative rotation angle is added to the azimuth angle.